# -*- coding: utf-8 -*-
#
# File: Reference.py
#
# Copyright (c) 2007 by Menttes - 2007
# Generator: ArchGenXML Version 2.0-beta8 (dev/svn)
#            http://plone.org/products/archgenxml
#
# GNU General Public License (GPL)
#

__author__ = """Roberto Allende <rover@menttes.com>"""
__docformat__ = 'plaintext'

from AccessControl import ClassSecurityInfo
from Products.Archetypes.atapi import *
from zope.interface import implements
import interfaces

from Products.CMFDynamicViewFTI.browserdefault import BrowserDefaultMixin
from Products.Reference.config import *

from Products.ATCountryWidget.Widget import CountryWidget
##code-section module-header #fill in your manual code here
##/code-section module-header

schema = Schema((

    StringField(
        name='type',
        widget=MultiSelectionWidget(
            label="Type",
            description="Enter the type of the referenc",
            label_msgid='Reference_label_type',
            description_msgid='Reference_help_type',
            i18n_domain='Reference',
            format='checkbox',
        ),
        vocabulary=['Legislation', 'Use', 'Education', 'Hardware', 'Development', 'Others']
    ),

    StringField(
        name='country',
        widget=CountryWidget(
            label='Country',
            label_msgid='Reference_label_country',
            i18n_domain='Reference',
        )
    ),

    StringField(
        name='externalUrl',
        default = "http://",
        widget=StringWidget(
            label='Externalurl',
            label_msgid='Reference_label_externalUrl',
            i18n_domain='Reference',
        )
    ),

    StringField(
        name='organizationUrl',
        default = "http://",
        widget=StringWidget(
            label='Organizationurl',
            label_msgid='Reference_label_organizationUrl',
            i18n_domain='Reference',
        )
    ),

    StringField(
        name='sourceUrl',
        default = "http://",
        widget=StringWidget(
            label='Sourceurl',
            label_msgid='Reference_label_sourceUrl',
            i18n_domain='Reference',
        )
    ),

),
)

##code-section after-local-schema #fill in your manual code here
##/code-section after-local-schema

Reference_schema = BaseSchema.copy() + \
    schema.copy()

##code-section after-schema #fill in your manual code here
##/code-section after-schema

class Reference(BaseContent, BrowserDefaultMixin):
    """
    """
    security = ClassSecurityInfo()
    implements(interfaces.IReference)

    meta_type = 'Reference'
    _at_rename_after_creation = True

    schema = Reference_schema

    ##code-section class-header #fill in your manual code here
    ##/code-section class-header

    # Methods

registerType(Reference, PROJECTNAME)
# end of class Reference

##code-section module-footer #fill in your manual code here
##/code-section module-footer



